package com.platform.config.rabbit;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * RabbitConfig
 *
 * @author 肖亮
 */
//@Configuration
public class RabbitConfig {
	private final static String FANOUT = "fanout.message";

	@Bean
	public Queue fanoutMessage() {
		return new Queue(FANOUT);
	}

	@Bean
	FanoutExchange fanoutExchange() {
		return new FanoutExchange("fanoutExchange");
	}

	@Bean
	Binding bindingExchangeMessage(Queue fanoutMessage, FanoutExchange fanoutExchange) {
		return BindingBuilder.bind(fanoutMessage).to(fanoutExchange);
	}
}
